package cc.vv.baselibrary.util;

import android.content.Context;
import android.content.Intent;

import org.jetbrains.annotations.NotNull;

import cc.vv.baselibrary.activity.BaseVideoPlayerActivity;
import cc.vv.baselibrary.util.router.RouterTransferCenterUtil;


/**
 * Date 2018/4/13
 * Describe  视频播放工具类
 *
 * @auther liuxin
 */

public class VideoPlayerUtils {

    private static VideoPlayerUtils mInstance;

    /**
     * 实例化
     *
     * @return
     */
    public static VideoPlayerUtils getInstance() {
        if (null == mInstance) {
            synchronized (VideoPlayerUtils.class) {
                if (null == mInstance) {
                    mInstance = new VideoPlayerUtils();
                }
            }
        }
        return mInstance;
    }

    public void playVideo(Context context, @NotNull String videoUrl) {
        Intent intent = RouterTransferCenterUtil.getInstance().getConventionalIntent(context, BaseVideoPlayerActivity.class);
        intent.putExtra(BaseVideoPlayerActivity.VideoPathLogo, videoUrl);
        RouterTransferCenterUtil.getInstance().routerStartActivity(context, intent);
    }
}
